from django.contrib.auth.models import User
from django.db import models


# Create your models here.
class News(models.Model):
    thumbnail = models.TextField(null=True)
    title = models.TextField()
    summary = models.TextField()
    link = models.TextField()

    create_date = models.DateTimeField(auto_now_add=True)
    author = models.ForeignKey(User, on_delete=models.SET_NULL, related_name="user_newses", null=True)

    def __unicode__(self):
        return self.title
